package com.parking.mapper;

import com.parking.pojo.Car;
import com.parking.pojo.User;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

public interface CarMapper {
    //增加
    @Insert("insert into car(carnumber,caruser) values (#{carnumber},#{caruser});")
    int add(Car car);

    //根据id删除
    @Delete("delete from car where carid = #{carid}")
    int delete(int carid);


    //根据id修改
    @Update("update car set caruser = #{caruser},carnumber = #{carnumber} where carid = #{carid}")
    int updateById(Integer caruser,String carnumber,Integer carid);

    //查询
    @Select("select * from car where carid = #{carid}")
    Car selectById(Integer carid);
}
